﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MISAPP.Classify.Service;

public partial class View_MIS_changPW : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        lblResult.Text = "";
    }

    protected void btnExecute_Click(object sender, EventArgs e)
    {
        if (!Page.IsValid)
        {
            lblResult.Text = "新密碼兩次要相符";
        }
        else
        {
            List<string> result = Session["result"] as List<string>;            
            bool ok = MISAPP.Classify.Service.Utility.ChangeUserPW(result[0]
                ,txtOldPW.Text,txtNewPw1.Text);
            lblResult.Text = ok.Equals(true) ? "更改成功" : "更改失敗";
        }
    }
}
